package kr.or.kead.ui.list.model;

import kr.or.kead.domain.Auth;
import kr.or.kead.domain.Professor;
import kr.or.kead.service.DaoCourse;
import kr.or.kead.service.DaoProfessor;
import kr.or.kead.service.DaoTable;
import kr.or.kead.ui.MainFrame;
import kr.or.kead.ui.meun.MenuMgn;

public class CourseCustomTableModel extends AbsCustomTableModel {
	private DaoTable daoCourse;
	private Auth auth;
	private DaoProfessor daoProf;
	public CourseCustomTableModel() {
		auth = MainFrame.getAuth();
		daoProf = new DaoProfessor();
		int level = auth.getLevel();
		if(level == 2) {
			String email = auth.getEmail();
			Professor prof = (Professor)daoProf.selectTableByEmail(email);
			sql = "select * from view_course_depart_prof where 교수명 = '" + prof.getName() + "'";
		}else {
			sql = "select * from view_course_depart_prof";
		}		
		getResultSet();
		daoCourse = new DaoCourse();
	}
	
	@Override
	public Object getValueAt(int row, int col) {
		Object[] course = arData.get(row);
		switch(col){
			case 0: case 1: case 2: 
			case 3: case 4: 
				return course[col];
		}
		return null;
	}
}
